/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dao;

import static org.easymock.EasyMock.*;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author jfernan
 */
public class DateServiceTest_easymock {

private DateDAO dateDAO;
	private DateService dateService;

	@Before
	public void setUp() throws Exception {
		dateDAO = createMock(DateDAO.class);
		dateService = new DateService();
		dateService.setDateDAO(dateDAO);
	}

	@Test
	public void testGetMatchPaid() {
		expect(dateDAO.findByCharacter("Cheap")).
			andReturn(new Person("Cheapy", "", "", true));
		replay(dateDAO);
		Person toMatch =
			new Person("Cheap", "Tight", "Pants", true);
		assertEquals(new Person("Cheapy", "", "", true),
				dateService.getMatch(toMatch));
		verify(dateDAO);
	}

	@Test
	public void testGetMatchNotPaid() {
	   Person toMatch =
	           new Person("Cheap", "Tight", "Pants", false);
	   assertEquals(new Person("Loving", "Your", "Mom", false),
	          dateService.getMatch(toMatch));
	}


}